//#ifdefined
#undef RGB

#ifndef _CLASSMODELINGRGB_
#define _CLASSMODELINGRGB_

namespace Modeling {

template<class T>
class RGB
{
public:
	~RGB() {}
	RGB(T R=0, T G=0, T B=0) : r(R), g(G), b(B){}

	void red(T red) {this->r = red;}
	T red() {return this->r;}

	void green(T green) {this->g = green;}
	T green() {return this->g;}

	void blue(T blue) {this->b = blue;}
	T blue() {return this->b;}

	T operator[](unsigned int index) {return ((T*)this)[index];}

private:
	T r;
	T g;
	T b;
};

typedef RGB<char> RGBc;
typedef RGB<short> RGBs;
typedef RGB<int> RGBi;
typedef RGB<unsigned char> RGBuc;
typedef RGB<unsigned short> RGBus;
typedef RGB<unsigned int> RGBui;
typedef RGB<float> RGBf;
typedef RGB<double> RGBd;

}// namespace Modeling

#endif
